package com.qin.mall.openfeign.discount;

import com.qin.mall.common.api.CommonResult;
import com.qin.malldiscount.domain.SmsFlashPromotion;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 限时购活动管理 远程调用
 * @author Leisure
 * create 2022 2022/11/24 19:50
 **/
@FeignClient("discount-manage")
public interface SmsFlashPromotionFeigin {

    /**
     * 添加活动
     */
    @PostMapping("/flashManage/create")
    @ResponseBody
    public CommonResult create(@RequestBody SmsFlashPromotion flashPromotion);

    /**
     * 编辑活动信息
     */
    @PostMapping("/flashManage/update/{id}")
    @ResponseBody
    public Object update(@PathVariable Long id, @RequestBody SmsFlashPromotion flashPromotion);

    /**
     * 删除活动信息
     */
    @PostMapping("/flashManage/delete/{id}")
    @ResponseBody
    public Object delete(@PathVariable Long id);

    /**
     * 修改上下线状态
     */
    @PostMapping("/flashManage/update/status/{id}")
    public Object update(@PathVariable Long id, @RequestParam Integer status);

    /**
     * 获取活动详情
     */
    @GetMapping("/flashManage/{id}")
    @ResponseBody
    public Object getItem(@PathVariable Long id);

    /**
     * 根据活动名称分页查询
     */
    @GetMapping("/flashManage/list")
    @ResponseBody
    public Object getItem(@RequestParam(value = "keyword", required = false) String keyword,
                          @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
                          @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum);
    
}
